# -*- coding: utf-8 -*-
from PySide6.QtCore import QThreadPool


# 创建线程池的单例类
class MyThreadPool(QThreadPool):
    _instance = None

    def __init__(self):
        super(MyThreadPool, self).__init__()
        self.globalInstance()
        self.setMaxThreadCount(10)

    @classmethod
    def get_instance(cls):
        if not cls._instance:
            cls._instance = MyThreadPool()
        return cls._instance
